<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>列表 - 手机客户端</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="css/style.css" />
<script src="js/jquery.js"></script>
<script src="js/touchslider.js"></script>
<script src="js/jquery.global.js"></script>
<script type="text/javascript">
	$(function($){
		var appTypeStr = getUrlParam("appType");
		var typeNameStr = getUrlParam("typeName");
		var $loadAjax = new $.LoadAjax({
			renderTarget : ".wrap #appList ul",
			fn : function(obj,data,mask){
					data = data.appInstallItemList;
					if(data.length==0){
						$(mask).remove();
						$(obj).text().trim()==""?$(obj).html('<li class="none">暂无匹配的应用。</li>'):null;
						$(window).unbind("scroll");
					}else{
						for(var i in data) {		
							$(obj).append('<li data-appId="'+data[i].appId+'" data-id="'+data[i].id+'"><dl><dd><img src="'+requestPicPath+data[i].picPath+'" /></dd><dt><strong>'+data[i].name+'</strong>'+(data[i].appVersion==null?'':'<span>版本:'+data[i].appVersion+'</span>|')+'<span>大小:'+data[i].size+'MB</span></dt><dd><button data-url="'+requestPicPath+data[i].url+'">免费下载</button>'+data[i].downloadTimes+'次</dd></dl></li>');
						}
						var dataSize=data.dataSize;
						pageSize=data.pageSize;
						var offset=data.offset+1;
						var pageNum=Math.ceil(dataSize/pageSize);
						pagenow=Math.ceil(offset/pageSize);
					}
			},
			url : requestPath+"/websamp/pubapi/mobile/loadFbsApp",
			pageSize : 12,
			appType : appTypeStr,
			picPath : requestPicPath,
			srcollingWrap : window
		});
		$loadAjax.init();
		$loadAjax.loadAppList();
		$loadAjax.scrollLoading();
		appTypeStr==""||typeNameStr==""?null:$(".wrap #banner").hide().next().find("h2").html(typeNameStr).slideDown();
		new $.Switchover().init();
		new $.Download({obj : ".wrap #appList ul li dl dd button"}).init();
	});
</script>
</head>
<body>
<div class="wrap">
  <div id="banner">
    <div>
      <ol>
        <li><a href="javascript:;"><img src="images/banner_01.jpg" /></a></li>
        <li><a href="javascript:;"><img src="images/banner_02.jpg" /></a></li>
        <li><a href="javascript:;"><img src="images/banner_03.jpg" /></a></li>
      </ol>
    </div>
  </div>
  <div id="appList" class="panel list">
  <h2></h2>
    <ul>
    </ul>
  </div>
</div>
<script type="text/javascript">
console=window.console || {dir:new Function(),log:new Function()}
new TouchSlider({id:'banner',direction:'left',auto:1,mouseWheel:true});
</script>
</body>
</html>